<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
      <el-form-item label="设备编码" prop="deviceId">
        <el-select
          v-model="queryParams.deviceId"
          placeholder="请选择设备"
          clearable
          filterable
          style="width: 180px"
        >
          <el-option
            v-for="item in deviceOptions"
            :key="item.deviceId"
            :label="`${item.deviceCode} - ${item.deviceName}`"
            :value="item.deviceId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="维护类型" prop="maintenanceType">
        <el-select
          v-model="queryParams.maintenanceType"
          placeholder="请选择类型"
          clearable
          style="width: 120px"
        >
          <el-option label="例行维护" value="routine" />
          <el-option label="故障维修" value="repair" />
          <el-option label="升级改造" value="upgrade" />
          <el-option label="清洁保养" value="clean" />
        </el-select>
      </el-form-item>
      <el-form-item label="维护人员" prop="maintenancePerson">
        <el-input
          v-model="queryParams.maintenancePerson"
          placeholder="请输入维护人员"
          clearable
          style="width: 120px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="维护结果" prop="maintenanceResult">
        <el-select
          v-model="queryParams.maintenanceResult"
          placeholder="请选择结果"
          clearable
          style="width: 120px"
        >
          <el-option label="成功" value="success" />
          <el-option label="失败" value="failed" />
          <el-option label="部分完成" value="partial" />
        </el-select>
      </el-form-item>
      <el-form-item label="维护时间" prop="maintenanceDateRange">
        <el-date-picker
          v-model="queryParams.maintenanceDateRange"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd"
          style="width: 240px"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:deviceMaintenanceLog:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:deviceMaintenanceLog:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:deviceMaintenanceLog:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:deviceMaintenanceLog:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table 
      v-loading="loading" 
      :data="deviceMaintenanceLogList" 
      @selection-change="handleSelectionChange"
      stripe
      border
      highlight-current-row
      class="common-table"
    >
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column label="ID" align="center" prop="maintenanceId" width="80" />
      <el-table-column label="设备信息" align="center" prop="deviceId" width="160">
        <template slot-scope="scope">
          <div>
            <div style="font-weight: 500; color: #409EFF;">{{ getDeviceCode(scope.row.deviceId) }}</div>
            <div style="font-size: 12px; color: #909399;">{{ getDeviceName(scope.row.deviceId) }}</div>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="维护类型" align="center" prop="maintenanceType" width="100">
        <template slot-scope="scope">
          <el-tag :type="getMaintenanceTypeTagType(scope.row.maintenanceType)" size="small">
            {{ getMaintenanceTypeLabel(scope.row.maintenanceType) }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="维护内容" align="left" prop="maintenanceContent" min-width="200" show-overflow-tooltip />
      <el-table-column label="维护人员" align="center" prop="maintenancePerson" width="100" />
      <el-table-column label="维护时间" align="center" width="160">
        <template slot-scope="scope">
          <div>
            <div style="font-size: 12px;">开始: {{ parseTime(scope.row.maintenanceStartTime, '{y}-{m}-{d}') }}</div>
            <div style="font-size: 12px;" v-if="scope.row.maintenanceEndTime">结束: {{ parseTime(scope.row.maintenanceEndTime, '{y}-{m}-{d}') }}</div>
            <div style="font-size: 12px; color: #E6A23C;" v-else>进行中</div>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="费用(元)" align="center" prop="maintenanceCost" width="100">
        <template slot-scope="scope">
          <span style="color: #F56C6C; font-weight: 500;">
            {{ scope.row.maintenanceCost ? parseFloat(scope.row.maintenanceCost).toFixed(2) : '-' }}
          </span>
        </template>
      </el-table-column>
      <el-table-column label="维护结果" align="center" prop="maintenanceResult" width="100">
        <template slot-scope="scope">
          <el-tag :type="getMaintenanceResultTagType(scope.row.maintenanceResult)" size="small">
            {{ getMaintenanceResultLabel(scope.row.maintenanceResult) }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="下次维护" align="center" prop="nextMaintenanceDate" width="100">
        <template slot-scope="scope">
          <div v-if="scope.row.nextMaintenanceDate">
            <div style="font-size: 12px;">{{ parseTime(scope.row.nextMaintenanceDate, '{y}-{m}-{d}') }}</div>
            <div style="font-size: 11px;" :style="{ color: getNextMaintenanceColor(scope.row.nextMaintenanceDate) }">
              {{ getMaintenanceDaysLeft(scope.row.nextMaintenanceDate) }}
            </div>
          </div>
          <span v-else style="color: #909399;">-</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:deviceMaintenanceLog:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:deviceMaintenanceLog:remove']"
            style="color: #F56C6C"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改设备维护记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-tabs v-model="activeTab" type="border-card">
          <el-tab-pane label="基本信息" name="basic">
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="关联设备" prop="deviceId">
                  <el-select v-model="form.deviceId" placeholder="请选择设备" filterable style="width: 100%">
                    <el-option
                      v-for="item in deviceOptions"
                      :key="item.deviceId"
                      :label="`${item.deviceCode} - ${item.deviceName}`"
                      :value="item.deviceId"
                    />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="维护类型" prop="maintenanceType">
                  <el-select v-model="form.maintenanceType" placeholder="请选择维护类型" style="width: 100%">
                    <el-option label="例行维护" value="routine">
                      <span style="color: #67C23A">例行维护</span>
                    </el-option>
                    <el-option label="故障维修" value="repair">
                      <span style="color: #F56C6C">故障维修</span>
                    </el-option>
                    <el-option label="升级改造" value="upgrade">
                      <span style="color: #E6A23C">升级改造</span>
                    </el-option>
                    <el-option label="清洁保养" value="clean">
                      <span style="color: #409EFF">清洁保养</span>
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="维护人员" prop="maintenancePerson">
                  <el-input v-model="form.maintenancePerson" placeholder="请输入维护人员" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="维护结果" prop="maintenanceResult">
                  <el-select v-model="form.maintenanceResult" placeholder="请选择维护结果" style="width: 100%">
                    <el-option label="成功" value="success">
                      <span style="color: #67C23A">成功</span>
                    </el-option>
                    <el-option label="失败" value="failed">
                      <span style="color: #F56C6C">失败</span>
                    </el-option>
                    <el-option label="部分完成" value="partial">
                      <span style="color: #E6A23C">部分完成</span>
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="维护内容" prop="maintenanceContent">
                  <el-input 
                    v-model="form.maintenanceContent" 
                    type="textarea" 
                    placeholder="请详细描述维护内容"
                    :rows="4"
                    maxlength="1000"
                    show-word-limit
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="时间费用" name="schedule">
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="开始时间" prop="maintenanceStartTime">
                  <el-date-picker 
                    v-model="form.maintenanceStartTime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="请选择维护开始时间"
                    style="width: 100%"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="结束时间" prop="maintenanceEndTime">
                  <el-date-picker 
                    v-model="form.maintenanceEndTime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="请选择维护结束时间"
                    style="width: 100%"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="维护费用" prop="maintenanceCost">
                  <el-input-number
                    v-model="form.maintenanceCost"
                    :min="0"
                    :precision="2"
                    placeholder="维护费用"
                    style="width: 100%"
                  >
                    <template slot="append">元</template>
                  </el-input-number>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="下次维护" prop="nextMaintenanceDate">
                  <el-date-picker 
                    v-model="form.nextMaintenanceDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择下次维护日期"
                    style="width: 100%"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="使用备件">
                  <el-card shadow="never" style="border: 1px dashed #dcdfe6;">
                    <div slot="header">
                      <span>备件清单</span>
                      <el-button type="text" size="small" @click="addSparePart" style="float: right;">
                        <i class="el-icon-plus"></i> 添加备件
                      </el-button>
                    </div>
                    <div v-if="sparePartsList.length === 0" style="text-align: center; color: #909399; padding: 20px;">
                      暂无备件记录
                    </div>
                    <div v-else>
                      <el-row v-for="(item, index) in sparePartsList" :key="index" :gutter="10" style="margin-bottom: 10px;">
                        <el-col :span="8">
                          <el-input v-model="item.name" placeholder="备件名称" size="small" />
                        </el-col>
                        <el-col :span="6">
                          <el-input-number v-model="item.quantity" :min="1" placeholder="数量" size="small" style="width: 100%" />
                        </el-col>
                        <el-col :span="6">
                          <el-input-number v-model="item.price" :min="0" :precision="2" placeholder="单价" size="small" style="width: 100%" />
                        </el-col>
                        <el-col :span="4">
                          <el-button type="danger" icon="el-icon-delete" size="small" @click="removeSparePart(index)"></el-button>
                        </el-col>
                      </el-row>
                    </div>
                  </el-card>
                </el-form-item>
              </el-col>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="备注信息" name="notes">
            <el-row :gutter="20">
              <el-col :span="24">
                <el-form-item label="维护备注" prop="maintenanceNote">
                  <el-input 
                    v-model="form.maintenanceNote" 
                    type="textarea" 
                    placeholder="请输入维护备注信息"
                    :rows="8"
                    maxlength="500"
                    show-word-limit
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listDeviceMaintenanceLog, getDeviceMaintenanceLog, delDeviceMaintenanceLog, addDeviceMaintenanceLog, updateDeviceMaintenanceLog } from "@/api/system/deviceMaintenanceLog";

export default {
  name: "DeviceMaintenanceLog",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 设备维护记录表格数据
      deviceMaintenanceLogList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 当前活跃标签
      activeTab: "basic",
      // 设备选项
      deviceOptions: [],
      // 备件清单
      sparePartsList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceId: null,
        maintenanceType: null,
        maintenancePerson: null,
        maintenanceResult: null,
        maintenanceDateRange: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        deviceId: [
          { required: true, message: "关联设备不能为空", trigger: "change" }
        ],
        maintenanceType: [
          { required: true, message: "维护类型不能为空", trigger: "change" }
        ],
        maintenanceContent: [
          { required: true, message: "维护内容不能为空", trigger: "blur" }
        ],
        maintenancePerson: [
          { required: true, message: "维护人员不能为空", trigger: "blur" }
        ],
        maintenanceStartTime: [
          { required: true, message: "维护开始时间不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
    this.getDeviceOptions();
  },
  methods: {
    /** 查询设备维护记录列表 */
    getList() {
      this.loading = true;
      // 处理日期范围查询
      if (this.queryParams.maintenanceDateRange && this.queryParams.maintenanceDateRange.length === 2) {
        this.queryParams.maintenanceStartTime = this.queryParams.maintenanceDateRange[0];
        this.queryParams.maintenanceEndTime = this.queryParams.maintenanceDateRange[1];
      } else {
        this.queryParams.maintenanceStartTime = null;
        this.queryParams.maintenanceEndTime = null;
      }
      
      listDeviceMaintenanceLog(this.queryParams).then(response => {
        this.deviceMaintenanceLogList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 获取设备选项 */
    getDeviceOptions() {
      // 这里应该调用设备API，暂时使用mock数据
      this.deviceOptions = [
        { deviceId: 10000, deviceCode: 'CAM-001', deviceName: '1号池塘摄像头' },
        { deviceId: 10001, deviceCode: 'CAM-002', deviceName: '2号池塘摄像头' },
        { deviceId: 10002, deviceCode: 'SENSOR-001', deviceName: '水质传感器A1' },
        { deviceId: 10003, deviceCode: 'FEEDER-001', deviceName: '投料设备B1' },
        { deviceId: 10004, deviceCode: 'AERATOR-001', deviceName: '增氧设备C1' }
      ];
    },
    /** 获取设备编码 */
    getDeviceCode(deviceId) {
      const device = this.deviceOptions.find(item => item.deviceId === deviceId);
      return device ? device.deviceCode : `ID:${deviceId}`;
    },
    /** 获取设备名称 */
    getDeviceName(deviceId) {
      const device = this.deviceOptions.find(item => item.deviceId === deviceId);
      return device ? device.deviceName : '未知设备';
    },
    /** 获取维护类型标签 */
    getMaintenanceTypeLabel(type) {
      const typeMap = {
        'routine': '例行维护',
        'repair': '故障维修',
        'upgrade': '升级改造',
        'clean': '清洁保养'
      };
      return typeMap[type] || type;
    },
    /** 获取维护类型标签类型 */
    getMaintenanceTypeTagType(type) {
      const typeMap = {
        'routine': 'success',
        'repair': 'danger',
        'upgrade': 'warning',
        'clean': 'primary'
      };
      return typeMap[type] || '';
    },
    /** 获取维护结果标签 */
    getMaintenanceResultLabel(result) {
      const resultMap = {
        'success': '成功',
        'failed': '失败',
        'partial': '部分完成'
      };
      return resultMap[result] || result;
    },
    /** 获取维护结果标签类型 */
    getMaintenanceResultTagType(result) {
      const resultMap = {
        'success': 'success',
        'failed': 'danger',
        'partial': 'warning'
      };
      return resultMap[result] || '';
    },
    /** 获取下次维护颜色 */
    getNextMaintenanceColor(date) {
      if (!date) return '#909399';
      const today = new Date();
      const maintenanceDate = new Date(date);
      const diffDays = Math.ceil((maintenanceDate - today) / (1000 * 60 * 60 * 24));
      
      if (diffDays < 0) return '#F56C6C'; // 已过期，红色
      if (diffDays <= 7) return '#E6A23C'; // 7天内，橙色
      if (diffDays <= 30) return '#409EFF'; // 30天内，蓝色
      return '#67C23A'; // 还很远，绿色
    },
    /** 获取维护剩余天数 */
    getMaintenanceDaysLeft(date) {
      if (!date) return '';
      const today = new Date();
      const maintenanceDate = new Date(date);
      const diffDays = Math.ceil((maintenanceDate - today) / (1000 * 60 * 60 * 24));
      
      if (diffDays < 0) return `过期${Math.abs(diffDays)}天`;
      if (diffDays === 0) return '今天到期';
      if (diffDays <= 7) return `${diffDays}天后`;
      return `${diffDays}天后`;
    },
    /** 添加备件 */
    addSparePart() {
      this.sparePartsList.push({
        name: '',
        quantity: 1,
        price: 0
      });
    },
    /** 删除备件 */
    removeSparePart(index) {
      this.sparePartsList.splice(index, 1);
    },
    /** 处理备件JSON */
    parseSparePartsUsed(jsonStr) {
      try {
        if (!jsonStr) return [];
        const data = JSON.parse(jsonStr);
        return data.items || [];
      } catch (e) {
        return [];
      }
    },
    /** 生成备件JSON */
    generateSparePartsJson() {
      if (this.sparePartsList.length === 0) return null;
      return JSON.stringify({
        items: this.sparePartsList.filter(item => item.name.trim() !== '')
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        maintenanceId: null,
        deviceId: null,
        maintenanceType: "routine",
        maintenanceContent: null,
        maintenancePerson: null,
        maintenanceStartTime: null,
        maintenanceEndTime: null,
        maintenanceCost: 0,
        sparePartsUsed: null,
        maintenanceResult: "success",
        maintenanceNote: null,
        nextMaintenanceDate: null,
        createBy: null,
        createTime: null
      };
      this.sparePartsList = [];
      this.activeTab = "basic";
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.maintenanceId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加维护记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const maintenanceId = row.maintenanceId || this.ids
      getDeviceMaintenanceLog(maintenanceId).then(response => {
        this.form = response.data;
        // 解析备件数据
        this.sparePartsList = this.parseSparePartsUsed(response.data.sparePartsUsed);
        this.open = true;
        this.title = "修改维护记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          // 生成备件JSON
          this.form.sparePartsUsed = this.generateSparePartsJson();
          
          if (this.form.maintenanceId != null) {
            updateDeviceMaintenanceLog(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDeviceMaintenanceLog(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const maintenanceIds = row.maintenanceId || this.ids;
      const deviceNames = row.deviceId ? this.getDeviceName(row.deviceId) : '选中的维护记录';
      this.$modal.confirm('是否确认删除"' + deviceNames + '"的维护记录？').then(function() {
        return delDeviceMaintenanceLog(maintenanceIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/deviceMaintenanceLog/export', {
        ...this.queryParams
      }, `deviceMaintenanceLog_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

<style scoped>
.common-table {
  margin-top: 10px;
}

.common-table .el-table__header th {
  background-color: #fafafa;
  color: #606266;
  font-weight: 500;
}

.el-tag {
  font-weight: 500;
}

.dialog-footer {
  text-align: right;
  padding-top: 20px;
}

.el-form .el-form-item__label {
  font-weight: 500;
  color: #606266;
}

.el-select .el-input__inner {
  cursor: pointer;
}

/* 搜索表单优化 */
.el-form--inline .el-form-item {
  margin-bottom: 10px;
}

/* 表格操作按钮间距 */
.el-table .cell .el-button + .el-button {
  margin-left: 5px;
}

/* 标签页优化 */
.el-tabs--border-card .el-tab-pane {
  padding: 20px;
}

.el-tabs--border-card .el-tabs__content {
  background-color: #fff;
}

/* 数字输入框优化 */
.el-input-number {
  width: 100%;
}

/* 弹窗宽度响应式 */
@media (max-width: 768px) {
  .el-dialog {
    width: 95% !important;
  }
}

/* 表格列头样式优化 */
.el-table th.is-leaf {
  border-bottom: 1px solid #EBEEF5;
}

/* 状态标签样式优化 */
.el-tag.el-tag--success {
  border-color: #67C23A;
}

.el-tag.el-tag--warning {
  border-color: #E6A23C;
}

.el-tag.el-tag--danger {
  border-color: #F56C6C;
}

.el-tag.el-tag--info {
  border-color: #909399;
}

.el-tag.el-tag--primary {
  border-color: #409EFF;
}

/* 备件卡片样式 */
.el-card__header {
  padding: 10px 20px;
  border-bottom: 1px solid #EBEEF5;
}

.el-card__body {
  padding: 20px;
}

/* 维护状态显示优化 */
.maintenance-status {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.maintenance-status > div {
  margin: 2px 0;
}

/* 费用显示优化 */
.cost-display {
  font-family: 'Courier New', monospace;
  font-weight: bold;
}
</style>
